﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0038)http://www.css88.com/tool/js_beautify/ -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Javascript格式化工具</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<SCRIPT type=text/javascript>
window.onload = function() {
    var c = document.forms[0].content;
    c && c.setSelectionRange && c.setSelectionRange(0, 0);
    c && c.focus && c.focus();
}
function do_js_beautify()
{
    document.getElementById('beautify').disabled = true;
    var js_source = document.getElementById('content').value.replace(/^\s+/, '');
    var indent_size = document.getElementById('tabsize').value;
    var indent_char = ' ';
    var preserve_newlines = document.getElementById('preserve-newlines').checked;

    if (indent_size == 1) {
        indent_char = '\t';
    }


    if (js_source && js_source[0] === '<') {
        document.getElementById('content').value = style_html(js_source, indent_size, indent_char, 80);
    } else {
        document.getElementById('content').value =
        js_beautify(js_source, {indent_size: indent_size, indent_char: indent_char, preserve_newlines:preserve_newlines});
    }

    document.getElementById('beautify').disabled = false;
    return false;
}
</SCRIPT>

<SCRIPT type=text/javascript src="Javascript格式化工具_files/beautify.js"></SCRIPT>

<SCRIPT type=text/javascript 
src="Javascript格式化工具_files/HTML-Beautify.js"></SCRIPT>

<STYLE type=text/css>FORM {
	MARGIN: 0px 10px
}
TEXTAREA {
	BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; WIDTH: 100%; PADDING-RIGHT: 3px; HEIGHT: 320px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 3px
}
H1 {
	BORDER-BOTTOM: #666 1px solid; FONT-FAMILY: "trebuchet ms", arial, sans-serif; MARGIN-BOTTOM: 15px; COLOR: #666; FONT-SIZE: 28px; FONT-WEIGHT: normal
}
SELECT {
	WIDTH: 19%
}
BUTTON {
	WIDTH: 100px; CURSOR: pointer
}
LABEL {
	FONT-FAMILY: arial, helvetica, sans-serif
}
TEXTAREA {
	FONT-FAMILY: terminus, consolas, "lucida console", "courier new", courier, monospace; FONT-SIZE: 12px
}
PRE {
	FONT-FAMILY: terminus, consolas, "lucida console", "courier new", courier, monospace; FONT-SIZE: 12px
}
SPAN.code {
	FONT-FAMILY: terminus, consolas, "lucida console", "courier new", courier, monospace; FONT-SIZE: 12px
}
PRE {
	MARGIN: 20px 0px; COLOR: #777
}
DIV#bottom {
	MARGIN: 20px; FONT-FAMILY: arial, helvetica, sans-serif; COLOR: #333; FONT-SIZE: 90%; BORDER-TOP: #ccc 1px solid
}
</STYLE>

<META name=GENERATOR content="MSHTML 8.00.7600.16490"></HEAD>
<BODY>
<H1>格式化 Javascript---<A class=STYLE2 
href="http://www.css88.com/">返回前端开发首页</A></H1>
<P>1.该工具主要用于将去掉空格的代码或者压缩成一行的格式化，方便阅读，不能将加密过的js还原破解；<BR>2.粘贴你代码到文本区域并点击格式化按钮就可以将代码格式化；支持jQuery，YUI等框架<BR>3.JavaScript 
压缩工具<A href="http://www.css88.com/tool/ysjs/" 
target=_blank>http://www.css88.com/tool/ysjs/</A> </P>
<FORM method=post action=?><TEXTAREA id=content rows=30 cols=30 name=content>/*   粘贴你代码到这里并点击格式化按钮   */
/*   例如格式化以下这段代码   */
if('this_is'==/an_example/){do_something();}else{var a=b?(c%d):e[f];}
      </TEXTAREA><BR><BR><BUTTON id=beautify onclick="return do_js_beautify()" 
type=submit>格式化</BUTTON> <SELECT id=tabsize name=tabsize> <OPTION 
  value=1>用“tab”键缩进</OPTION> <OPTION value=2>缩进2个空格</OPTION> <OPTION selected 
  value=4>缩进4个空格</OPTION> <OPTION value=8>缩进6个空格</OPTION></SELECT> <INPUT 
id=preserve-newlines CHECKED type=checkbox><LABEL for=preserve-newlines> 
保存现有的换行符？</LABEL> </FORM><BR><BR><BR>
<P>由<A href="http://jsbeautifier.org/" 
target=_blank>http://jsbeautifier.org/</A>提供技术支持</P><!--google统计-->
<SCRIPT type=text/javascript>
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</SCRIPT>

<SCRIPT type=text/javascript>
try {
var pageTracker = _gat._getTracker("UA-3448069-1");
pageTracker._trackPageview();
} catch(err) {}</SCRIPT>
</BODY></HTML>
